package com.service.Impl;

import com.dao.BillDao;
import com.pojo.Bill;
import com.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BillServiceImpl implements BillService {
    @Autowired
    private BillDao billDao;

    @Override
    public Boolean doAddBillService(Bill bill) {
        int row = billDao.addBillDao(bill);
        if (row>0){
            return true;
        }
        return false;
    }

    @Override
    public Boolean doDeleteBillService(int id) {
        int row = billDao.deleteBillDao(id);
        if (row>0){
            return true;
        }
        return false;
    }

    @Override
    public Boolean doUpdateBillService(Bill bill) {
        int row = billDao.updateBillDao(bill);
        if (row>0){
            return true;
        }
        return false;
    }

    @Override
    public Bill findBillByid(int id) {
        return billDao.findBillByid(id);
    }

    @Override
    public List<Bill> findAll() {
        return billDao.findAll();
    }

    @Override
    public List<Bill> findSearchBill(Bill bill) {
        return billDao.searchBill(bill);
    }
}
